package com.yanyeori.framework.jira.jiraclient.greenhopper;

import com.yanyeori.framework.jira.jiraclient.Field;
import net.sf.json.JSONObject;

/**
 * GreenHopper estimate sum for rapid views.
 */
public class EstimateSum {

    private final Double value;
    private final String text;

    /**
     * Creates an estimate sum from a JSON payload.
     *
     * @param json JSON payload
     */
    protected EstimateSum(JSONObject json) {
        value = Field.getDouble(json.get("value"));
        text = Field.getString(json.get("text"));
    }

    public Double getValue() {
        return value;
    }

    public String getText() {
        return text;
    }
}
